
#ifndef _CSUBJECT_H_
#define _CSUBJECT_H_

#include <list>
#include "ISubject.h"
#include "IObserver.h"

using namespace std;


class CSubject : public ISubject
{
    public:
        CSubject();
        virtual ~CSubject();

    public:
        bool attach(IObserver* theObserver);
        void detach(IObserver* theObserver);
        
        int getData();
        void setData(int theData);
    
    private:
        void notify();

    private:
        list <IObserver*> itsObservers;
        int myData;

};

#endif /* _CSUBJECT_H_ */
